<?php
include 'parse-post-meta.php';
$postsPath = dirname(dirname(__FILE__)) . '/source/posts';
echo $postsPath, "\n";

$allowExt = array('html', 'md', 'markdown');
if ($handle = opendir($postsPath)) {
    while (false !== ($file = readdir($handle))) {
        if ($file != '.' && $file != '..') {
            $path = $postsPath . '/' . $file;
            $info = pathinfo($path);
            if (isset($info['extension']) && in_array($info['extension'], $allowExt)) {
                echo $path, "\n";
                //echo file_get_contents($path);
                var_dump(parsePostMeta($path));
            }
        }
    }
    closedir($handle);
}